package com.zjdiepu.www.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 项目名称：dp-base <br/> 
 * 类名称：OSSProperty <br/>  
 * 类描述：阿里云对象操作 <br/>    
 * 创建人：xiongxiaotun <br/> 
 * 创建时间：2017年3月27日 下午3:06:26  <br/>   
 * 修改人：xiongxiaotun <br/> 
 * 修改时间：2017年3月27日 下午3:06:26   <br/>  
 * 修改备注：    <br/> 
 * @version V1.0   <br/>
 */
@Component
@PropertySource(value = { "classpath:oss.properties" })
public class OSSProperty {
	/**
	 * 访问凭据
	 */
	private String keyId;
	/**
	 * 凭据秘钥
	 */
	private String keySecret;
	/**
	 * 阿里云对象存储根目录
	 */
	private String bucketName;
	/**
	 * 客户端终端
	 */
	private String clientEndPoint;
	
	/**
	 * 资源访问
	 */
	private String endPoint;
	
	/**
	 * 临时授权时间（秒）
	 */
	private Integer authorizedTime;
	
	/**
	 * 白名单
	 */
	private String whiteList;
	
	/**
	 * 本地备份
	 */
	private Boolean localCopy;
	
	/**
	 * 是否异步上传
	 */
	private Boolean synSwitch;
	
	/**
	 * 是否回调
	 */
	private Boolean callbackSwitch;
	
	/**
	 * 回调主机
	 */
	private String callbackHost;
	/**
	 * 回调主机
	 */
	private String callbackUrl;
	

	public String getKeyId() {
		return keyId;
	}
	@Value("${oss.keyId}")
	public void setKeyId(String keyId) {
		this.keyId = keyId;
	}

	public String getKeySecret() {
		return keySecret;
	}
	@Value("${oss.keySecret}")
	public void setKeySecret(String keySecret) {
		this.keySecret = keySecret;
	}

	public String getBucketName() {
		return bucketName;
	}
	@Value("${oss.bucketName}")
	public void setBucketName(String bucketName) {
		this.bucketName = bucketName;
	}

	public String getClientEndPoint() {
		return clientEndPoint;
	}
	@Value("${oss.clientEndPoint}")
	public void setClientEndPoint(String clientEndPoint) {
		this.clientEndPoint = clientEndPoint;
	}

	public String getEndPoint() {
		return endPoint;
	}
	
	@Value("${oss.endPoint}")
	public void setEndPoint(String endPoint) {
		this.endPoint = endPoint;
	}

	public Integer getAuthorizedTime() {
		return authorizedTime;
	}
	
	@Value("${oss.authorizedTime}")
	public void setAuthorizedTime(Integer authorizedTime) {
		this.authorizedTime = authorizedTime;
	}
	
	public String getWhiteList() {
		return whiteList;
	}
	
	@Value("${oss.whiteList}")
	public void setWhiteList(String whiteList) {
		this.whiteList = whiteList;
	}
	public Boolean getSynSwitch() {
		this.synSwitch = (null == this.synSwitch ? false : this.synSwitch);
		return this.synSwitch;
	}
	public Boolean getLocalCopy() {
		this.localCopy = (null == this.localCopy ? false : this.localCopy);
		return this.localCopy;
	}
	@Value("${oss.localCopy}")
	public void setLocalCopy(Boolean localCopy) {
		this.localCopy = localCopy;
	}
	@Value("${oss.synSwitch}")
	public void setSynSwitch(Boolean synSwitch) {
		this.synSwitch = synSwitch;
	}
	public String getCallbackHost() {
		return callbackHost;
	}
	
	public void setCallbackHost(String callbackHost) {
		this.callbackHost = callbackHost;
	}
	public String getCallbackUrl() {
		return callbackUrl;
	}
	
	@Value("${oss.callbackUrl}")
	public void setCallbackUrl(String callbackUrl) {
		this.callbackUrl = callbackUrl;
	}
	
	public Boolean getCallbackSwitch() {
		this.callbackSwitch = (null == this.callbackSwitch ? false : this.callbackSwitch);
		return this.callbackSwitch;
	}
	@Value("${oss.callbackSwitch}")
	public void setCallbackSwitch(Boolean callbackSwitch) {
		this.callbackSwitch = callbackSwitch;
	}
}
